package qz_rpt

class OnceCheckByMonthController {

    def commonDataService
    def dynamicQueryService
    def index(Integer max) {
        def cellList = org.kdx.DataUtils.getCellList()
        def pageSizeList = org.kdx.DataUtils.getPageSizeList()

        [totalCount: 5, pageSize: 20, pageCurrent: 1, orderField: 'id', orderDirection: 'asc', pageSizeList: pageSizeList, cellList: cellList]
    }
    def onceCheckByMonth(){
        def pageCurrent = params.pageCurrent ? Integer.parseInt(params.pageCurrent) : 1
        def pageSize = params.pageSize ? Integer.parseInt(params.pageSize) : 10
        params.startno = (pageSize * (pageCurrent - 1)) + 1
        params.endno = pageSize * pageCurrent
        def pageSizeList = [10,20,50,100]
        params.SYS_QUERY_NAME = 'onceCheckByMonth'
        def onceCheckByMonth = dynamicQueryService.queryForList(params)
        def tableHeadList =  []
        if(onceCheckByMonth.size()>0){
            tableHeadList =  onceCheckByMonth[0].keySet()
        }
        params.SYS_QUERY_NAME = 'onceCheckByMonthCount'
        def totalCount = dynamicQueryService.queryForList(params)[0].TOTALCOUNT


        params.SYS_QUERY_NAME = 'onceCheckByMonthPicList'
        def onceCheckByMonthPicList = dynamicQueryService.queryForList(params)
        params.SYS_QUERY_NAME = 'onceCheckByMonthCateList'
        def onceCheckByMonthCateList = dynamicQueryService.queryForList(params)
        params.SYS_QUERY_NAME = 'onceCheckByMonthStepList'
        def onceCheckByMonthStepList = dynamicQueryService.queryForList(params)
        [tableHeadList:tableHeadList,totalCount:totalCount,
         pageSizeList:pageSizeList,pageSize:pageSize,time:params.time?:'',
         startno:params.startno?:'',endno:params.endno?:'',partPicNum:params.partPicNum?:'',
         onceCheckByMonth:onceCheckByMonth,totalCount:totalCount,
        onceCheckByMonthPicList:onceCheckByMonthPicList, onceCheckByMonthCateList:onceCheckByMonthCateList
        ,group3:params.gourp3?:'',category:params.category?:'',group3:params.group3?:'',onceCheckByMonthStepList:onceCheckByMonthStepList,
                step:params.step?:''
        ]
    }
}
